package com.tinyideatech.system.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tinyideatech.common.core.entity.BaseEntity;
import lombok.Data;

import java.util.Date;

@Data
@TableName("sys_user")
public class SysUser  extends BaseEntity {

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @TableId
    private Long userId;
    private String nickname;
    private String username;
    private String email;
    private String phonenumber;
    private String sex;
    private String avatar;
    private String password;
    private String status;
    private String loginIp;
    private Date loginDate;
    private Integer administrator;
    private String remark;

    @TableLogic
    private Integer delFlag;

    @TableField(exist = false)
    private String roleIds;

    private Boolean isAdmin(){
        if(this.administrator != null && this.administrator == 1){
            return true;
        }
        return false;
    }

}
